home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Bank smakow / BankSmakow.air / BankSmakow.swf / scripts / com / makingwaves / util / IngredientsFormatter.as < prev   
Text File  |  2009-12-16  |  1KB  |  39 lines

  1. package com.makingwaves.util
  2. {
  3.    import com.makingwaves.model.ModelLocator;
  4.    import com.makingwaves.vo.Ingredient;
  5.    import com.makingwaves.vo.Product;
  6.    import mx.formatters.Formatter;
  7.    
  8.    public class IngredientsFormatter extends Formatter
  9.    {
  10.        
  11.       
  12.       public function IngredientsFormatter()
  13.       {
  14.          super();
  15.       }
  16.       
  17.       public static function format(param1:Object) : String
  18.       {
  19.          var _loc3_:String = null;
  20.          var _loc4_:Ingredient = null;
  21.          var _loc5_:Product = null;
  22.          var _loc2_:ModelLocator = ModelLocator.getInstance();
  23.          if(param1 != null && param1 is Array)
  24.          {
  25.             _loc3_ = "";
  26.             for each(_loc4_ in param1)
  27.             {
  28.                if((_loc5_ = _loc2_.selectedProducts[_loc4_.productId] as Product) != null)
  29.                {
  30.                   _loc3_ += _loc5_.name + ", ";
  31.                }
  32.             }
  33.             _loc3_ = _loc3_.substr(0,_loc3_.length - 2);
  34.          }
  35.          return _loc3_;
  36.       }
  37.    }
  38. }
  39.